﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DearlerPlatform.Common
{
    public static class ConfigurationFile
    {
        /// <summary>
        /// 配置文件读取接口
        /// </summary>
        public static IConfiguration Configuration { get; set; }

        /// <summary>
        /// 读取项目的json配置文件
        /// </summary>
        /// <param name="str">配置文件的路径如 "ConnectionStrings:Default"</param>
        /// <returns>配置文件的值</returns>
        public static string GetConfig(string str)
        {
            return Configuration[str];
        }
    }
}
